package com.yummy.mapper;

import com.yummy.dto.PermissionVo;
import com.yummy.entity.Permission;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PermissionMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Permission record);

    Permission selectByPrimaryKey(Integer id);

    List<Permission> selectAll();

    int updateByPrimaryKey(Permission record);

    List<PermissionVo> selectAllMenu();

    List<Long> selctPermissionIdByRoleId(int id);

    List<PermissionVo> selectMenuByManager(int mid);

    @Select("select role_id from employee where id =  #{mid}")
    int selectRoleIdById(int mid);
}